package com.elitel.frame.main.entity.enums;



/**
 * 服务调用次数统计枚举类
 *
 * @author mulis
 */
public enum StatEnum {
    /**
     * 统计7天的服务调用次数需用enum
     */
    DAY7(7, 10);


    StatEnum(Integer days, Integer limit) {
        this.days = days;
        this.daysSub1 = days - 1;
        this.limit = limit;
    }

    /**
     * 实际统计天数
     */
    private final Integer days;
    /**
     * 实际统计天数减1
     */
    private final Integer daysSub1;
    /**
     * 统计条数
     */
    private final Integer limit;

    public String getRedisKey(String currPre) {
        return currPre + days;
    }

    public String getRedisSub1Key(String currPre) {
        return currPre + daysSub1;
    }


    public Integer getDaysSub1() {
        return daysSub1;
    }

    public Integer getDays() {
        return days;
    }

    public Integer getLimit() {
        return limit;
    }
}